package com.ruoyi.merchant.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.merchant.mapper.CfMerchantMapper;
import com.ruoyi.merchant.domain.CfMerchant;
import com.ruoyi.merchant.service.ICfMerchantService;

/**
 * 商户Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-13
 */
@Service
public class CfMerchantServiceImpl implements ICfMerchantService 
{
    @Autowired
    private CfMerchantMapper cfMerchantMapper;

    /**
     * 查询商户
     *
     * @param merchantId 商户主键
     * @return 商户
     */
    @Override
    public CfMerchant selectCfMerchantByMerchantId(Long merchantId)
    {
        return cfMerchantMapper.selectCfMerchantByMerchantId(merchantId);
    }

    /**
     * 查询商户列表
     *
     * @param cfMerchant 商户
     * @return 商户
     */
    @Override
    public List<CfMerchant> selectCfMerchantList(CfMerchant cfMerchant)
    {
        return cfMerchantMapper.selectCfMerchantList(cfMerchant);
    }

    @Override
    public List<CfMerchant> getMerchantByMerchantIdOrderByRate(CfMerchant cfMerchant) {
        return cfMerchantMapper.getMerchantByMerchantIdOrderByRate(cfMerchant);
    }

    /**
     * 新增商户
     *
     * @param cfMerchant 商户
     * @return 结果
     */
    @Override
    public int insertCfMerchant(CfMerchant cfMerchant)
    {
        return cfMerchantMapper.insertCfMerchant(cfMerchant);
    }

    /**
     * 修改商户
     *
     * @param cfMerchant 商户
     * @return 结果
     */
    @Override
    public int updateCfMerchant(CfMerchant cfMerchant)
    {
        return cfMerchantMapper.updateCfMerchant(cfMerchant);
    }

    /**
     * 批量删除商户
     *
     * @param merchantIds 需要删除的商户主键
     * @return 结果
     */
    @Override
    public int deleteCfMerchantByMerchantIds(Long[] merchantIds)
    {
        return cfMerchantMapper.deleteCfMerchantByMerchantIds(merchantIds);
    }

    /**
     * 删除商户信息
     *
     * @param merchantId 商户主键
     * @return 结果
     */
    @Override
    public int deleteCfMerchantByMerchantId(Long merchantId)
    {
        return cfMerchantMapper.deleteCfMerchantByMerchantId(merchantId);
    }

    @Override
    public List<CfMerchant> selectCfMerchantListByData(CfMerchant cfMerchant) {
        return cfMerchantMapper.selectCfMerchantListByData(cfMerchant);
    }

    @Override
    public List<CfMerchant> selectCfMerchantAndOrderList() {
        return cfMerchantMapper.selectCfMerchantAndOrderList();
    }

}
